using System.Collections.Generic;
using KamLib;

namespace Ext.Net.UIS
{
    public class BoolFieldEditor : TermEditor
    {
        public static BoolFieldEditor Default = new BoolFieldEditor();
        public override IEnumerable<AbstractComponent> NewControls(TermNode node, UisCreateControlArgs e)
        {
            node.Flex = 0;
            return this.NewFieldControls<Checkbox>(node, e, a =>
            {
                if (!node.Have(TermTags.Header)) return;
                a.BoxLabel = node.Title;
                a.HideLabel = true;
            });
        }
    }
}